<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

Route::get('/', function () {
    return view('welcome');
});

/**
 * 注册权限路由
 */
Route::auth();

/**
 * 管理后台
 */
Route::group(['namespace' => 'Admin', 'prefix' => 'admin', 'middleware' => ['auth']], function(){

    //首页
    Route::get("/home", "HomeController@index");
    Route::get("/index", "IndexController@index");

});

/**
 * 基础设置
 */

Route::group(['namespace' => 'BaseSet', 'prefix' => 'BaseSet','middleware' => ['auth']], function(){
    //微信参数配置
    Route::get("/Parameter", "ParameterController@index");
    Route::post("/getParameter", "ParameterController@getParameter");
    //自定义菜单
    Route::get("/Nav", "NavController@index");
    Route::any("/add", "NavController@add");//添加菜单栏
    Route::any("/edit", "NavController@edit");//编辑菜单栏
    Route::any("/del", "NavController@del");//删除菜单栏
    //关键词管理
    Route::get("/Keyword", "KeywordController@index");
    Route::any("/add", "KeywordController@add");
    Route::any("/del", "KeywordController@del");
});
/**
 * 微信路由
 */
Route::group(['namespace' => 'Wechat', 'prefix' => 'wechat', 'middleware' => ['cors']], function(){
    //首页
    Route::any('/server', 'IndexController@serve');
    // 生成菜单
    Route::get('/menu', 'IndexController@setMenu');
    //生成自定义菜单栏
    Route::get('/makeMenu','MenuController@makeMenu');
});



